package org.rexsong.sample.petstore.repositories;

import java.util.List;
import org.rexsong.sample.petstore.models.Pet;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;

public interface PetRepository extends CrudRepository<Pet, Long> {
    @Cacheable("pets-by-type")
    List<Pet> findByType(String type);

    List<Pet> findByStatus(String status);

    @Cacheable("pets-all")
    List<Pet> findAll();
}
